//
//  StandardImagView.swift
//  CooperSwift_Example
//
//  Created by 计海峰 on 2021/6/4.
//  Copyright © 2021 CocoaPods. All rights reserved.
//

import Foundation
import UIKit

public extension UIImageView {
    
    // 图标
    func standListIconConfig(_ name: String = "", size: CGSize = CGSize(0, 0), width iconWidth: CGFloat = 0) {
        image = UIImage(named: name)
        isHidden = false
        var width = CGFloat()
        var height = CGFloat()
        if size.width > 0 {
            width = size.width
            height = size.height
        }
        if iconWidth > 0 {
            width = iconWidth
            height = iconWidth
        }
        if width > 0 || height > 0 {
            self.snp.updateConstraints {
                $0.width.equalTo(width)
                $0.height.equalTo(height)
            }
        }
    }
    
}
